# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-symmetric-jsonrpc
pkgname=('python2-python-symmetric-jsonrpc' 'python-python-symmetric-jsonrpc')
_pkgname=python-symmetric-jsonrpc
pkgver=0.1
pkgrel=9
pkgdesc='A more beautiful JSON-RPC implemenntation in python.'
arch=('any')
url='https://pypi.org/project/python-symmetric-jsonrpc/#files'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://github.com/niligulmohar/$_pkgname/archive/release-$pkgver.zip")
sha512sums=('ebd99c4d02ddfe180c019d16010b49e5ec2855cb45ff9208fd3e2c8844b92ed122b0fde19696132a193cacf4be784bd0a350a1ddc5e8ad226b25e38ac7c345b8')

prepare() {
  cp -a "$_pkgname-release-$pkgver" "$_pkgname-release-$pkgver-2"
}

build() {
  cd "$_pkgname-release-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-release-$pkgver"

  python setup.py build
}

package_python2-python-symmetric-jsonrpc() {
  depends=('python2')

  cd "$_pkgname-release-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-python-symmetric-jsonrpc() {
  depends=('python')

  cd "$_pkgname-release-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

